<!-- 左侧列表下拉菜单模板 -->
<template>
  <div class="template-body">
    <section class="left-side">
      <leftAsideList :propsData="propsData" :catList="catList"></leftAsideList>
    </section>
    <section
      class="template-content"
      :class="showContentMask ? 'no-scroll' : ''"
    >
      <div class="ad-box">
        <classifyAd :propsData="propsData"></classifyAd>
      </div>
      <dropDownMenu
        :propsData="propsData"
        @showMenuBg="showMenuBg"
        @closeMenuBg="closeMenuBg"
        :catList="catList[0].children"
      ></dropDownMenu>
      <div class="content-mask" v-if="showContentMask"></div>
      <section class="goods-section">
        <goodsList :propsData="propsData" :goodsList="catList[0].children[0].goods_list || []"></goodsList>
      </section>
    </section>
  </div>
</template>

<script>
import leftAsideList from "../components/leftAsideList/index.vue";
import classifyAd from "../components/classifyAd/index.vue";
import dropDownMenu from "../components/dropDownMenu/index.vue";
import goodsList from "../components/goodsList/index.vue";

export default {
  name: "",
  props: {
    propsData: {
      type: Object,
      default: {},
    },
    catList:{
      type: Array,
      default: () => {
        return []
      },
    }
  },
  mixins: [],
  components: { leftAsideList, classifyAd, goodsList, dropDownMenu },
  data() {
    return {
      showContentMask: false,
    };
  },
  mounted() {},
  watch: {},
  computed: {
    styleType() {
      return this.propsData.params.styleType || "1";
    },
  },
  methods: {
    showMenuBg() {
      this.showContentMask = true;
    },
    closeMenuBg() {
      this.showContentMask = false;
    },
  },
};
</script>

<style lang="scss" scoped>
.template-body {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-start;
  padding-top: 6px;
  .left-side {
    width: 101px;
    background: #f2f2f2;
    height: 100%;
  }
  .template-content {
    flex: 1;
    height: 100%;
    background: #ffffff;
    overflow-x: hidden;
    overflow-y: scroll;
    position: relative;
    .ad-box {
      width: 100%;
      background: #ffffff;
      position: relative;
      z-index: 20;
    }
    .goods-section {
      width: 100%;
      padding: 0 16px;
    }

    .content-mask {
      width: 100%;
      height: 100%;
      position: absolute;
      left: 0;
      top: 0;
      z-index: 11;
      background-color: #000000;
      opacity: 0.5;
    }
  }
  .no-scroll {
    overflow: hidden;
  }
  ::-webkit-scrollbar {
    width: 0;
    height: 0;
  }
}
</style>
